$ ->
    token = chance.guid()
    msg_request = ->
        $.ajax 'http://' + host + '/messages/?token=' + token,
            type: 'GET'
            dataType: 'json'
            cache: false
            success: (data, status, jqXHR) ->
                $('#messages').append "[" + data.name + "] " + data.key + " | " + data.value + "<br/>"
                    
                $.ajax 'http://' + host + '/clients',
                    type: 'GET'
                    dataType: 'json'
                    cache: false
                    success: (data, status, jqXHR) ->
                        $('#sources').html('Sources connected: ' + data.join(','))
                
                msg_request()

    msg_request()